home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / windows / ini_lib3.zip / README.TXT < prev    next >
Text File  |  1997-05-11  |  3KB  |  93 lines

  1. 4/11/97
  2.  
  3. Well, I have finally updated the library to include the ability to update
  4. the parameters within the ini file.  I have also renamed the old functions to
  5. "read_ini" from "parse_string".  Consequently, the new function is called
  6. "write_ini".  The function parameter list is the same.  The parameter list
  7. deserves further clarification:
  8.  
  9.      int read_ini( char *filename, char *field_name, char *data,
  10.                    char *return_string ) or
  11.  
  12.      int write_ini( char *filename, char *field_name, char *data,
  13.                     char *new_string )
  14.  
  15.  
  16.      where:
  17.                 *filename      = Character pointer to filename (ini file)
  18.                 *fieldname     = the "[fieldname]" section identifier in
  19.                                  inifile
  20.                 *data          = the name "data" in the string "data=5"
  21.                 *return_string = the "5" in the string "data=5"
  22.                 *new_string    = the new value to be written where the "5"
  23.                                  is in the string "data=5"
  24.  
  25.  
  26. The file "test_ini.ini" is a backup file of the "test.ini".  The test program
  27. modifies "test.ini" with a new value for "a=".  The backup file is used so 
  28. that you can review it to ensure that the file was modified.
  29.  
  30. As before, the use of the libs are Freeware and as such you can use them 
  31. as you see fit.  There is no warranty expressed or implied with this software
  32. and you may use it at your own risk...This last statement sounds scary, but 
  33. I am using this libs in a commercial product, and have not had any problems...
  34.  
  35.  
  36.  
  37. 02/03/95
  38.  
  39. This is a fix note... In the Previous version, I did not close the
  40. file properly...This may have caused some null pointer problems...Anyway,
  41. this is now fixed.  Further, I am including both the Small and Large Models
  42. for MSC V7.0.  Not too many people I know use Medium memory model, so I
  43. did not include it.  If you want it, send me a message and I will give
  44. you one.
  45.  
  46. When I get some free time, I will enhance the functionality of the lib to
  47. include writing to the ini files as well...Until then...
  48.  
  49. Overview
  50.  
  51. This library allows the C programmer parse "ini" files for specific data.
  52. The ini files are expected to look like Window's ini files.  i.e.
  53.  
  54.  
  55. [name]
  56. data=1
  57. debug=yes
  58.  
  59. [name2]
  60. port=2
  61.  
  62.  
  63. etc.
  64.  
  65. The user merely passes the filename, bracketed name, and the data name.
  66. The function will return the data to the right of the equal sign.  The data
  67. is returned as a character string.  However, for numeric data, the character
  68. string can be parsed using sscanf (C function) to read in the appropriate
  69. numeric data.
  70.  
  71. I have enclosed a Small (ini_s.lib), Medium (ini_m.lib), and Large (ini.l.lib)
  72. Libraries along with a header file and a sample program.
  73.  
  74.  
  75. These libraries are donated to the CompuServe subscribers who have assisted
  76. me in the past...  Anyone may use these libs as they see fit.
  77.  
  78. The Libs were compiled under MSC V 7.0
  79.  
  80. The Test program was compiled using:
  81.  
  82.         cl /c /AS test.c
  83.  
  84. Linked using
  85.         link test.c,,,ini_s,,
  86.  
  87.  
  88. Enjoy the libs!
  89.  
  90. Sam Saprunoff
  91.  
  92. 73730,72
  93.